﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Collections;
/// <summary>
///GoodsClass 的摘要说明
/// </summary>
public class GoodsClass
{
    DbClass dbobj=new DbClass();
	public GoodsClass()
	{
		//
		//TODO: 在此处添加构造函数逻辑
		//
	}
    public void dlBind(DataList dlName, DataTable dsTable)
    {
        if (dsTable != null)
        {
            dlName.DataSource = dsTable.DefaultView;
            dlName.DataKeyField = dsTable.Columns[0].ToString();
            dlName.DataBind();
        }
    }
    public void DLDeplayGI(int intDeplay, DataList dlName, string TableName)
    {
        SqlCommand mycmd = dbobj.GetCommandProc("proc_DeplayGI");
        SqlParameter Deplay = new SqlParameter("@Deplay", SqlDbType.Int, 4);
        Deplay.Value = intDeplay;
        mycmd.Parameters.Add(Deplay);
        dbobj.ExecNonQuery(mycmd);
        DataTable dsTable = dbobj.GetDataSet(mycmd, TableName);
        dlBind(dlName, dsTable);
    }
    public string GetClass(int IntClassID)
    {
        SqlCommand mycmd = dbobj.GetCommandProc("proc_GCN");
        SqlParameter classID = new SqlParameter("@ClassID", SqlDbType.Int, 4);
        classID.Value = IntClassID;
        mycmd.Parameters.Add(classID);
        return dbobj.ExecScalar(mycmd).ToString();
    }
}